import request from '@/utils/request.js'
import { useTokenStore } from '@/stores/token.js'
export const  articleCategoryListService=()=>{
       //获取token状态
       //const tokenStore = useTokenStore();
       //通过请求头Authorization携带token
    //    return request.get('/category', { headers: { 'Authorization': tokenStore.token } })  
     return request.get('/category')
}
//添加文章分类
export const articleCategoryAddService = (categoryData) => {
    return request.post('/category', categoryData)
}
export const articleCategoryUpdateService = (categoryData)=>{
    return request.put('/category',categoryData)
}
//删除分类
export const articleCategoryDeleteService = (id) => {
    return request.delete('/category?id='+id)
}
export const articleListService = (params) => {
    return request.get('/article', { params: params })
}
export const articleAddService = (articleData)=>{
    return request.post('/article',articleData)
}

